﻿using System;
using DeepEarth.Map.Core;
using DeepEarth.Map.Core.Tiling;

namespace DeepEarth.Map.TileSources
{
	/// <summary>
	/// A map mode describes a set of tiles and their opacity. It is used with the MapView Mode and SecondaryModes properties.
	/// </summary>
	public class MDSTileSourceProvider : BaseTileSourceProvider<MDSTileSourceFactory>
	{
		public MDSTileSourceProvider()
			: this(MDSTileSourceFactory.StreetMap)
		{
		}

		protected MDSTileSourceProvider(MapMode mode)
			: base(mode)
		{
			if (Mode == MDSTileSourceFactory.StreetMap)
			{
				var tileSource = TileSourceFactory.CreateTileSource(Mode);

				if (tileSource != null)
					TileSourcesCollection.Add(tileSource);
			}

		}

		public override BaseTileSourceProvider Clone()
		{
			var result = new MDSTileSourceProvider();
			FillClone(result);
			return result;
		}

	}
}